<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="RolePowerManager.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <link rel="stylesheet" href="${ctx}/css/common.css" type="text/css"></link>
  <link rel="stylesheet" href="${ctx}/css/reset.css" type="text/css"></link>
  <script type="text/javascript" src="${ctx}/js/jquery-1.7.2.js"></script>
  <script type="text/javascript" src="${ctx}/js/jquery.easydrag.handler.beta2.js"></script>
 <script type="text/javascript" src="${ctx}/js/My97DatePicker/WdatePicker.js"></script>
  <script type='text/javascript' src='${ctx}/dwr/interface/ContractManager.js'></script>
  <script type="text/javascript" src="${ctx}/js/Dossier/ContractManager.js"></script>
  <script type='text/javascript' src='${ctx}/dwr/interface/DutyManager.js'></script>
<script type='text/javascript' src='${ctx}/dwr/engine.js'></script>
  <script type='text/javascript' src='${ctx}/dwr/util.js'></script>

   <SCRIPT type=text/javascript>
    var clock = new Clock();
    clock.display(document.getElementById("clock"));
	</SCRIPT>

  </head>

  <body>
     <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
			<TR height=28>
				<TD background=${ctx}/images/title_bg1.jpg style="FONT-SIZE: 12px;">
					当前位置:人员档案管理 >> 员工合同查询
				</TD>
			</TR>
			<TR>
				<TD bgColor=#b1ceef height=1></TD>
			</TR>
			<TR height=20>
				<TD background=${ctx}/images/shadow_bg.jpg></TD>
			</TR>
		</TABLE>
		<form action="GetContractServlet" method="post" id="searchform">
	  <div class="query" >
	  <div class="querytype">
	  	<label>查询条件：</label>
	  	<select class="queryselect" name="searchtype" id="searchtype">
			<option value="empno">
			员工编号
			</option>
			<option value="conno">
			合同编号
			</option>
			<option value="dutyn">
			职位
			</option>
		</select>
		<input class="queryinput" name="keycode" id="keycode"/>
	  </div>
	  	<div class="querybtn">
	  		<span class="STYLE1"><img src="${ctx}/images/a1.gif" width="9" height="9" /></span>
            <span class="STYLE1"> </span><a href="javaScript:search()" style="cursor: pointer;">查询</a><span class="STYLE1"></span>
	  	</div>
      <div style="float: right; padding-right: 20px">
	  			<span class="STYLE1"><img src="${ctx}/images/001.gif" width="9" height="9" /></span>
            	<span class="STYLE1"> </span><a href="javaScript:clickAddContract('add_div')">新增</a><span class="STYLE1"></span>
	  	</div>
	  <div class="clear"></div>
	  </div>
	  </form>
        <div class="bottom" ></div>
        <div id="main">
        <table id="detail_t">
          <tr>
          <th>序号</th>
            <th>员工编号</th>
            <th>员工姓名</th>
            <th>合同编号</th>
            <th>开始时间</th>
            <th>结束时间</th>
            <th>职位</th>
            <th>合同内容</th>
            <th>补充内容</th>
            <th>更多操作</th>
          </tr>
          <c:forEach items="${page.list}" var="t" varStatus="stat" >
          <tr class="items">
         <td>${stat.count}</td>
          	<td id="${stat.count}${1}">${t.emp.empno}</td>
          	<td id="${stat.count}${2}">${t.emp.name}</td>
          	<td id="${stat.count}${3}">${t.contractno}</td>
          	<td id="${stat.count}${4}">${t.starttime}</td>
          	<td id="${stat.count}${5}">${t.endtime}</td>
          	<td id="${stat.count}${6}">${t.duty.name}</td>
          	<td id="${stat.count}${7}">${t.content}</td>
          	<td id="${stat.count}${8}">${t.supplement}</td>

            <td height="18" bgcolor="#FFFFFF">
            <div align="center">
            <span class="STYLE1"><img src="${ctx}/images/037.gif" width="9" height="9" /></span>
            <span class="STYLE1"> [</span><a href="javaScript:clickEditContract('${stat.count}','${t.id}','edit_div')">编辑</a><span class="STYLE1">]</span>
            &nbsp;&nbsp;&nbsp;
            <span class="STYLE2"><img src="${ctx}/images/010.gif" width="9" height="9" /></span>
            <span class="STYLE2"> </span><span class="STYLE1">[</span><a href="javaScript:deleteContract('${t.id}')">删除</a><span class="STYLE1">]</span>
            </div>
            </td>
		 </c:forEach>
        
        </table>
			<div class="manu">共${page.totalCount}条记录当前第<font color="#ff6600">${page.pageNo}/${page.pageCount}</font>页
				<a href="GetContractServlet?pageNo=${1}">首页</a>
				<a href="GetContractServlet?pageNo=${page.pageNo-1}">上一页</a>
				<a href="GetContractServlet?pageNo=${page.pageNo+1}">下一页</a>
				<a href="GetContractServlet?pageNo=${page.pageCount}">末页 </a>
				每页显示<input type="text" id="pageSize" name="pageSize" size="2"/>条
    	<input type="button" onclick="changePageSize()" value="提交"/>
			</div>
		</div>
		
 			<div id="edit_div" class="pop_box">
			<div class="p_head">
				<span class="p_h_title">合同详情</span> 
				<span><a class="p_h_close" onclick="hideDiv('edit_div');" title="close">X</a>
				</span>
			</div>
			<div class="p_box_body" id="p_b_body">
				<div class="p_con">
					<table id="p_con_t">
					  <tr>
					    <td class="t1">员工编号：</td>
					    <td><div class="txt-fld"><input id="empno_edit" type="text"/></div></td>
					  </tr>
					  <tr>
					    <td class="t1">合同编号：</td>
					    <td>
					    <div class="txt-fld">
					    <input id="contractno_edit" type="text"/>
					    </div>
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">开始时间：</td>
					   <td>
					   <div class="txt-fld"> 
					   <input id="starttime_edit" type="text" onClick="WdatePicker()"/>
					   </div>
					   </td>
					  </tr>
					  <tr>
					    <td class="t1">结束时间：</td>
					   <td>
					   <div class="txt-fld"> 
					   <input id="endtime_edit" type="text" onClick="WdatePicker()"/>
					   </div>
					   </td>
					  </tr>
					  <tr>
					    <td class="t1">职位：</td>
					    <td>
					    <div class="txt-fld">
					    <select id="duty_edit">
					    </select>
					    </div></td>
					  </tr>
					  <tr>
					    <td class="t1">合同内容：</td>
					   <td>
					   <div class="txt-fld">
					    <input id="content_edit" type="text"/>
					    </div>
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">补充内容：</td>
					   <td>
					   <div class="txt-fld">
					   <input id="supplement_edit" type="text"/>
					    </div></td>
					  </tr>
					  <tr>
					  	<td></td>
					  	<td><input id="contractid" style="visibility:hidden;width:0;height:0;"/>
					  		<input type="button" onclick="updateContract()" value="提交"/>
					  	</td>
					  </tr>
					</table>
				</div>
			</div>
		</div>
		<div id="add_div" class="pop_box">
			<div class="p_head">
				<span class="p_h_title">新增合同</span> 
				<span><a class="p_h_close" onclick="hideDiv('add_div');" title="close">X</a>
				</span>
			</div>
			<div class="p_box_body" id="p_b_body">
				<div class="p_con">
					<table id="p_con_t">
					  <tr>
					    <td class="t1">员工编号：</td>
					    <td><div class="txt-fld"><input id="empno_add" type="text"/></div></td>
					  </tr>
					  <tr>
					    <td class="t1">合同编号：</td>
					    <td>
					    <div class="txt-fld">
					    <input id="contractno_add" type="text"/>
					    </div>
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">开始时间：</td>
					   <td>
					   <div class="txt-fld"> 
					   <input id="starttime_add" type="text" onClick="WdatePicker()"/>
					   </div>
					   </td>
					  </tr>
					  <tr>
					    <td class="t1">结束时间：</td>
					   <td>
					   <div class="txt-fld"> 
					   <input id="endtime_add" type="text" onClick="WdatePicker()"/>
					   </div>
					   </td>
					  </tr>
					  <tr>
					    <td class="t1">职位：</td>
					    <td>
					    <div class="txt-fld">
					    <select id="duty_add">
					    <option></option>
					    </select>
					    </div></td>
					  </tr>
					  <tr>
					    <td class="t1">合同内容：</td>
					   <td>
					   <div class="txt-fld">
					    <input id="content_add" type="text"/>
					    </div>
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">补充内容：</td>
					   <td>
					   <div class="txt-fld">
					   <input id="supplement_add" type="text"/>
					    </div></td>
					  </tr>
					  
					  <tr>
					  	<td>&nbsp;</td>
					  	<td>
					  		<input type="button" value="添加" onclick="addContract();"/>
					  	</td>
					  </tr>
					</table>
				</div>
			</div>
		</div>
</body>
</html>
